package com.ruoyi.system.api;


import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author 侯文波
 * @date 2025/3/13 14:07
 * @description:
 */
@FeignClient(contextId = "equipmentService",value = ServiceNameConstants.EQUIPMENT_SERVICE)
public interface EquipmentService {

    @PostMapping("/pest/insertTimeData")
    public String insertCq(@RequestBody CqTimeData cqTimeData);

    @PostMapping("/environmental/insertTimeData")
    public String insertQx(@RequestBody QxTimeData qxTimeData);

    @PostMapping("/soil/insertTimeData")
    public String insertSoil(@RequestBody SoilTimeData soilTimeData);
    @PostMapping("/warning/sendMsg")
    public AjaxResult snedMsg(@RequestParam(value = "phoneNumber") String phoneNumber, @RequestParam(value = "code") String code);
    @PostMapping("/warning/getAllBySourceId")
    public AjaxResult getAllBySourceId(@RequestParam(value = "sourceId",required = false)Long sourceId);
    @PostMapping("/record")
    public AjaxResult add(@RequestBody AgrAlertRecordVo agrAlertRecord);

    //获取环境调控设备开关状态
    @PostMapping("/regulation/inner")
    public Integer getAgrEnvRegulationByEquipmentIdInner(@RequestParam("equipmentId") Long equipmentId);
    //环境调控设备开关
    @PostMapping("/regulation/updateStatus")
    public AjaxResult updateStatus(@RequestBody Map<String, Object> params);
//    环境调控设备定时关闭
    @PostMapping("/regulation/scheduleCountdown")
    public AjaxResult scheduleCountdownEq(@RequestParam("exeTime") Double exeTime, @RequestParam("equipmentId") Long equipmentId);



    //水肥机开关状态
    @PostMapping("/waf/inner")
    public Integer getSfStatusByEquipmentIdInner(@RequestParam("equipmentId") Long equipmentId);
    //水肥机开
    @PostMapping("/waf/updateAgrEquipmentFertigation")
    public AjaxResult updateAgrEquipmentFertigation(@RequestBody AgrEquipmentFertigation agrEquipmentFertigation);
   //水肥机定时关闭
    @PostMapping("/waf/scheduleCountdown")
    public AjaxResult scheduleCountdown(@RequestBody AgrEquipmentFertigation agrEquipmentFertigation) ;

}
